Selection of an egress ip address for egress traffic of a distributed cloud computing network

ABSTRACT

A map of IP addresses of a distributed cloud computing network to one or more groupings is stored. The IP addresses are anycast IP addresses for which compute servers of the distributed cloud computing network share. These IP addresses are to be used as source IP addresses when transmitting traffic to destinations external to the cloud computing network. The map is made available to external destinations. Traffic is received at the distributed cloud computing network that is destined to an external destination. An IP address is selected based on the characteristic(s) applicable for the traffic and the map. The distributed cloud computing network transmits the traffic to the external destination using the selected IP address.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application is a continuation of Ser. No. 17/409,535, filed Aug.23, 2021, which claims the benefit of U.S. Provisional Application No.63/200,351, filed Mar. 2, 2021, and U.S. Provisional Application No.63/197,284, filed Jun. 4, 2021, which are hereby incorporated byreference.

FIELD

Embodiments of the invention relate to the field of a distributed cloudcomputing network; and more specifically, to the selection of an egressIP address for egress traffic of a distributed cloud computing network.

BACKGROUND

Requests from internet client devices are transmitted to origin serversto fetch the content that the user is requesting. Some origin serversmust know where the client is located so that they can serve localizedcontent and/or add location-based restrictions. For instance, someorigin servers have regulations and/or licenses that limit the servingof content to users in a certain region or country. For example, anorigin server in the United Kingdom may be legally or contractuallyrequired to only serve content to users located in the United Kingdom.If such an origin server receives traffic from a known IP that may beused for spoofing locations (e.g., a Virtual Private Network (VPN)), theorigin server may be required to block that traffic. Further, if theorigin server performs a geolocation database lookup of the IP addressand that IP address is of a VPN server (or other server that is not theclient device), the determined location will not necessarily be that ofthe client device. As another example, some origin servers may want toprovide different content for users in different locations. Forinstance, an origin server may want to provide an English version of thewebsite for users in predominantly English-speaking countries and aFrench version of the website for users in France. Although standardizedmethods to specify language content exist in some protocols, likeAccept-Language in HTTP, they are often ignored in favor of moreaccurate IP based geolocation.

Anycast networks, which are commonly used by content delivery networks(CDNs) and other cloud platforms, are conventionally only used at theserver-side for bidirectional layer-4 connections such as TransmissionControl Protocol (TCP) or User Datagram Protocol (UDP). Anycast allowsthe same IP address space to be used by many servers by advertising thesame IP subnet(s). An inbound-connecting client connects to the serverthat is closest to the client in terms of routing protocol configuration(e.g., Border Gateway Protocol (BGP) configuration) according to ananycast implementation as determined by the network infrastructure(e.g., router(s), switch(es), and/or other network equipment). Outboundconnections, however, where the CDN or cloud platform server acts as theclient and connects to an origin server for example, conventionally useseparate unicast IP addresses. This is because layer 4 protocols (e.g.,TCP or applications on top of UDP) typically require state to be kept onboth sides of the connection so return packets need to arrive at thesame host that initiated the connection.

SUMMARY

Selecting an egress IP address for egress traffic in a distributed cloudcomputing network is described in an embodiment. A mapping of egress IPaddresses to one or more groupings is stored and accessible at thedistributed cloud computing network. The mapping may be used forsegmenting traffic and may be based on the characteristic(s) of users,characteristic(s) of the client devices, characteristic(s) of the clientnetwork applications, and/or characteristics of internet traffic. Forexample, a mapping of egress IP addresses to geographic locations may bestored. The map is made available to destinations external to thedistributed cloud computing network. Traffic is received at thedistributed cloud computing network that is destined to an externaldestination. An egress IP address is selected based on characteristic(s)applicable for the traffic and the map. The distributed cloud computingnetwork transmits the traffic to the external destination using theselected egress IP address.

In an embodiment, the egress IP addresses are anycast IP addresses andadvertised by multiple or all the data centers of the distributed cloudcomputing network. As a result, it is possible that traffic is sent andreceived by two different servers of the distributed cloud computingnetwork. In an embodiment, a server that receives return traffic that itdid not originate forwards the return traffic to a server thatoriginated the traffic for further processing. In an embodiment, priorto transmitting the traffic to the origin, an exit data center isdetermined that is expected to receive the return traffic; and thetraffic is proxied to that data center.

BRIEF DESCRIPTION OF THE DRAWINGS

The invention may best be understood by referring to the followingdescription and accompanying drawings that are used to illustrateembodiments of the invention. In the drawings:

FIG. 1 illustrates a system for selecting an egress IP address in adistributed cloud computing network according to an embodiment.

FIG. 2 illustrates an example hierarchy of the system of recordaccording to an embodiment.

FIG. 3 is a flow diagram that illustrates exemplary operations forselecting an egress IP address for use in outgoing traffic in adistributed cloud computing network according to an embodiment.

FIG. 4 is a flow diagram that illustrates exemplary operations forprocessing return traffic at the distributed cloud computing networkaccording to an embodiment.

FIG. 5 illustrates a system for proxying L4 connections between an entrycompute server and an exit compute server in a distributed cloudcomputing network according to an embodiment.

FIG. 6 is a flow diagram that illustrates exemplary operations forproxying L4 connections between an entry compute server and an exitcompute server in a distributed cloud computing network according to anembodiment.

FIG. 7 illustrates a system for proxying L4 connections between an entrycompute server and an exit compute server in a distributed cloudcomputing network according to an embodiment.

FIG. 8 is a flow diagram that illustrates exemplary operations forproxying L4 connections between an entry compute server and an exitcompute server in a distributed cloud computing network according to anembodiment.

DESCRIPTION OF EMBODIMENTS

A method and system for selecting an egress IP address for egresstraffic in a distributed cloud computing network is described in anembodiment. The distributed cloud computing network includes multipledata centers that are geographically distributed. There may be hundredsto thousands of data centers and each data center includes one or morecompute servers. IP traffic destined to an origin network is received atthe distributed cloud computing network instead of being receivedinitially at the origin network. Outgoing traffic from the distributedcloud computing network may have different source IP addresses thanincoming traffic. For instance, instead of forwarding traffic from aclient device with the source IP address of the client device, aparticular compute server may transmit the traffic from the clientdevice using an IP address of the distributed cloud computing network asthe source IP address. These IP addresses are referred herein as “egressIP addresses.” For example, the distributed cloud computing network mayprovide a VPN service where the source IP address of the client deviceis not visible to an origin network.

In an embodiment, a mapping of egress IP addresses to one or moregroupings is stored and accessible at the distributed cloud computingnetwork. The mapping may be used for segmenting traffic and may be basedon the characteristic(s) of users, characteristic(s) of the clientdevices, characteristic(s) of the client network applications, and/orcharacteristics of Internet traffic. For example, the egress IPaddresses may be mapped to one or more of the following: geographiclocations (e.g., countries, regions, cities, latitude/longitude, zonesof population using specific dominant language, etc.), organization(e.g., company 1 employees, company 2 employees), bot likelihood,trusted vs untrusted traffic, quality of service to be applied to thetraffic, mobile vs non-mobile client device, manufacturer of clientdevice, and/or priority level of the traffic. The distributed cloudcomputing network receives ingress traffic from client devices that isdestined to destinations external to the distributed cloud computingnetwork. The distributed cloud computing network determinescharacteristic(s) of the users responsible for the traffic,characteristic(s) of the client devices transmitting the traffic,characteristic(s) of the client network applications being used on theclient devices transmitting the traffic, and/or characteristic(s) of theingress traffic itself. The distributed cloud computing network uses thedetermined characteristic(s) and the mapping of egress IP addresses whenselecting egress IP addresses. The traffic may then be segmentedaccording to the segmentation criteria and treated differently ifdesired.

In an embodiment, the mapping of egress IP addresses is to geographiclocations (e.g., countries, regions, cities, latitude/longitude, zonesof population using specific dominant language, etc.). This geolocationmapping may be exported or available to public geolocation databases.The geolocation mapping does not necessarily reflect the location of aparticular data center. Rather, the mapping may reflect the expectedlocation(s) of the originators of the traffic (e.g., the expectedlocation(s) of requesting client devices). After a request is receivedat the distributed cloud computing network where the request is destinedto an origin network, a geographic location of the requester (e.g., thevisiting client device) is determined (e.g., based on the source IPaddress of the request). An egress IP address is chosen based on thedetermined location of the requester and the mapping of egress IPaddresses to geographic location. For instance, a geohash of thedetermined location of the requester and a geohash of the mappedgeographic locations are compared. The egress IP address thatcorresponds to the closest geohash of the mapped geographic locationswith the geohash of the determined location of the requester is chosenin some embodiments. By way of example, if the determined location ofthe requester is in Nevada and the closest mapped geographic location isin California, an egress IP address mapped to California may be used.Thus, if the origin network uses a public geolocation database to lookupthe location of the IP address (e.g., to serve localized content or tofulfill legal or contractual obligations), the location will be that ofthe requesting client device and not necessarily of the distributedcloud computing network.

As another example, the mapping of egress IP addresses is to differententities (e.g., organizations such as companies). For example, a groupof IP addresses (e.g., a /24 subnet) may be mapped to a first entity andanother group of IP addresses (e.g., a different /24 subnet) may bemapped to a second entity. The distributed cloud computing networkreceives traffic and determines that it is attributable to an entity(e.g., by examining the HTTP host header or through server nameindication (SNI), destined for an IP address belonging to that entity)and selects an egress IP address according to the mapping. For example,if the traffic is attributed to the first entity, the distributed cloudcomputing network uses an egress IP address from one of the group of IPaddresses mapped to that first entity. The entity may then, for example,configure their network to accept traffic/connections only from themapped group of IP addresses. For example, the first entity mayconfigure their network to accept traffic/connections with source IPaddresses belonging to the first group of IP addresses.

In an embodiment, the egress IP addresses are anycast IP addresses. Insuch an embodiment, the egress IP addresses are advertised by multipleor all the data centers. As such, connections to the origin can beinitiated, using the same egress IP address, from multiple computeservers and/or multiple data centers at the same time. Since the egressIP addresses are anycast IP addresses, return traffic may be received atmultiple compute servers and/or multiple data centers. Thus, it ispossible that traffic sent from a compute server and/or data centeroriginating a connection may not receive the response traffic directlyfrom the origin (instead the traffic could arrive at a different computeserver and/or data center due to the different compute server beingcloser to the origin than the originating compute server according to ananycast implementation). The response traffic may be forwarded from thedifferent compute server to the originating compute server for furtherprocessing and transmission back to the requesting client.

The egress IP addresses and port space may be split across computeservers, data centers, and/or data center groups dynamically. Forinstance, IP addresses that are geolocated in a particular country(e.g., United States) may be scaled up or down depending on load. Asystem of record (SOR) can be used for determining the appropriateegress IP address and port. For instance, a control process running in adata center may consult the SOR to determine the egress IP address andport to allocate and/or use.

The SOR can be hierarchical. For instance, the top layer of thehierarchy may have one or more advertised egress IP subnets (e.g., a /24subnet) maintained by a set of multiple groups (e.g., regions) of datacenters. Each group includes one or more data centers, and each datacenter maintains the set of advertised IP subnets. For example, theremay be a United States group that includes multiple data centers locatedin the United States that advertise a first IP subnet, and a Europeangroup that includes multiple data centers that advertise a second,different, IP subnet. The mapping from subnet to data centers may berelatively constant (e.g., changing no more often than weekly).

The next layer of the SOR hierarchy may be a data center layer. Forexample, within each group of data centers, each data center may beassigned one or more IP addresses (e.g., one or more /32 IP addresses)from the IP subnet advertised by the group. The IP address assignment isstored in a group database that is available to the data centers of thegroup. The IP address assignment may change more frequently than thesubnet mapping. For example, the IP address to data center mapping maychange hourly.

The next layer of the SOR hierarchy may be a compute server layer. Eachcompute server of the data center reserves a port range on a specificdata center allocated egress IP address. Port range can be reserved inblocks of a predefined amount (e.g., 1000 ports). The ports on aspecific address do not overlap within the data center. For instance, afirst compute server within the data center may be allocated ports10000-10999 on a specific IP address and a second compute server withinthe data center may be allocated ports 11000-11999 on the same IPaddress. The reserved port range allocations are stored in a database.The port range allocations change more frequently than the IP addressassignment. For example, the port range allocations may change on theorder of minutes.

In cases where the egress IP addresses are anycast IP addresses, acompute server and/or data center that receives ingress traffic from aclient device that is destined to an external destination, proxies thelayer-4 connection (e.g., a TCP connection) to a different computeserver and/or data center that is expected to receive return traffic forthis connection, according to an embodiment. The compute server and/ordata center that receives ingress traffic from a client device issometimes referred herein as the entry compute server and/or entry datacenter, and the different compute server and/or data center is sometimesreferred herein as the exit compute server and/or exit data center. Forinstance, if the closest compute server and/or data center to the origin(as determined by an anycast implementation) is different from thecompute server and/or data center that receives ingress traffic from aclient device, it is likely that the closest compute server and/or datacenter from the origin will receive the return traffic for theconnection. In such a case, the entry compute server and/or data centerproxies the L4 connection to the exit compute server and/or exit datacenter in an embodiment. The exit compute server makes the L4 connectionto the origin. The return traffic may be forwarded from the exit computeserver back to the entry compute server and/or data center fortransmission back to the requesting client.

FIG. 1 illustrates a system for selecting an egress IP address in adistributed cloud computing network according to an embodiment. Thedistributed cloud computing network 120 includes multiple data centers125A-N. There may be hundreds to thousands of data centers, for example.The data centers 125A-N are geographically distributed (e.g., throughoutthe world). The data centers 125A-N include one or more computeserver(s) 128A-N, respectively. Each data center 125 can also includeone or more control servers, one or more DNS servers (e.g., one or moreauthoritative name servers, one or more proxy DNS servers), and/or oneor more other pieces of network equipment such as router(s), switch(es),and/or hubs. In an embodiment, each compute server 128 within a datacenter 125 may process IP traffic (e.g., HTTP/S, SPDY, FTP, TCP, UDP,IPSec, SIP, or other IP protocol traffic). The data centers 125A-N areconnected across the public internet. The system also includes theorigin network 130 that includes the origin server 132. The originnetwork 130 is the origin for IP traffic and is a destination that isexternal to the distributed cloud computing network 120.

The system includes the client device 110 that is a computing device(e.g., laptop, desktop, smartphone, mobile phone, tablet, gaming system,wearable device, Internet-of-Things (IoT) device, set-top box, etc.)that can access network resources through a client network application115 (e.g., a browser, a mobile application, or other networkapplication). The client device 110 may execute a tunnel client 117(e.g., VPN client, local forward proxy, or other tunnel client) as partof the client network application 115 or connected to the client networkapplication 115. The tunnel client 117 is operative to establish atunnel connection (e.g., a VPN connection) with one of the computeservers within the distributed cloud computing network 120. By way ofexample, the first compute server may be the compute server thatconnects with the client device over the tunnel because is closest tothe client device in terms of routing protocol configuration (e.g.,Border Gateway Protocol (BGP) configuration) according to an anycastimplementation as determined by the network infrastructure (e.g.,router(s), switch(es), and/or other network equipment). For instance,the tunnel client 117 may establish a VPN tunnel with the VPN serverexecuting on one of the compute servers 128 of the data centers 125A-N.While a single client device is illustrated, any number of clientdevices can be in communication with each one of the servers 128A-N ofthe data centers 125A-N.

The tunnel client 117 may register with the system including generatinga random keypair (public key and private key). In an embodiment, duringregistration, an initial tunnel route configuration may be transmittedto the tunnel client 117 that specifies the compute server 128A as theendpoint of the tunnel. In another embodiment, the initial tunnel routeconfiguration specifies the anycast IP address shared between thecompute servers 128A-N. In such an embodiment, the compute server 128Aconnects to the tunnel client 117 because it is the one of the computeservers 128A-N that is closest to the client device 110 in terms ofrouting protocol configuration (e.g., BGP configuration) according to ananycast implementation.

The client network application 115 transmits a request 180 that isreceived at one of the compute server(s) 128A of the data center 125A.The request 180 may be transmitted over a VPN tunnel established betweenthe client device 110 and the compute server 128A. The request 180 isdestined for a destination that is external to the distributed cloudcomputing network 120 (e.g., a destination handled by the origin server132). Outgoing traffic from the distributed cloud computing network 120may have different source IP addresses than incoming traffic. Forinstance, instead of forwarding the request 180 from the client device110 with the source IP address of the client device, the compute server128A may transmit the traffic from the client device using an egress IPaddress (an IP address of the distributed cloud computing network 120).

The compute server(s) 128A-N store or have access to a mapping of egressIP addresses to one or more groupings. The mapping may be used forsegmenting traffic and may be based on characteristic(s) of users,characteristic(s) of client devices, characteristic(s) of client networkapplications, and/or characteristics of internet traffic. For example,the egress IP addresses may be mapped to one or more of the following:geographic locations (e.g., countries, regions, cities,latitude/longitude, zones of population using specific dominantlanguage, etc.), organization (e.g., company 1 employees, company 2employees), bot likelihood, trusted vs untrusted traffic, quality ofservice to be applied to the traffic, mobile vs non-mobile clientdevice, manufacturer of client device, and/or priority level of thetraffic. The example illustrated in FIG. 1 shows a mapping ofgeolocations to egress IP addresses and selecting egress IP addressesbased on geolocations of the client devices. However, the egress IPaddresses may be selected based on other characteristic(s) as describedabove.

The geolocation to egress IP mapping 150 maps egress IP addresses togeographic locations (e.g., countries, regions, cities,latitude/longitude, zones of population using specific dominantlanguage, etc.). The geolocation mapping may be published 175 orotherwise available to public geolocation databases such as the publicgeolocation database 160 or be available for access (e.g.,downloadable). The origin servers may use the mapping (e.g., throughaccessing the public geolocation database 160 or downloading themapping) to lookup the geolocation of IP addresses (e.g., to servelocalized content or to fulfill legal or contractual obligations). Thecompute servers may use one of the IP addresses on the geolocation toegress IP mapping 150 when transmitting outgoing traffic (e.g., to theorigin server 132). The geolocation to egress IP mapping 150 does notnecessarily reflect the location of a particular data center or computeserver. Rather, the mapping may reflect the determined location(s) ofthe originators of the traffic (e.g., the determined location(s) ofrequesting client devices).

The compute server 128A that receives the request 180 determines thegeographic location of the request 180. For example, the compute server128A may access the public geolocation database 160 to determine thegeolocation of the request based on the source IP address of therequest. As another example, if the client device can provide locationservices (e.g., through use of GPS or other geolocation), the computeserver 128A may request the client device 110 provide its locationand/or otherwise receive the location data from the client device 110.To prevent the tunnel client 117 from forging such parameters, thecompute server 128A may require cryptographic authentication of sensorinformation from the client device operating system or hardware.

The compute server, at operation 182, selects an egress IP based on thedetermined location of the requester and the geolocation to egress IPmapping 150. For instance, a geohash of the determined location of therequester and a geohash of the mapped geographic locations are compared.The egress IP address that corresponds to the closest or otherwisepreferred geohash of the mapped geographic locations with the geohash ofthe determined location of the requester may be chosen. In anembodiment, each compute server may use any of the IP addresses on thegeolocation to egress IP mapping 150 regardless of the location of theclient and the location of the compute server. For instance, a computeserver located in Europe may use an egress IP address that is mapped toCalifornia if the determined geolocation of the requester is inCalifornia. In another embodiment, compute servers can only selectcertain IP addresses that are in the same geographic region. In such anembodiment using the same example, the compute server located in Europemay only be allowed to use egress IP addresses that are mapped tolocations in Europe. If that compute server receives traffic from aclient that has a determined geolocation in California, the computeserver may transmit the traffic to a compute server that is allowed touse egress IP addresses that are mapped to California (e.g., a computeserver located in California) and that compute server will transmit theoutgoing traffic. In the example shown in FIG. 1 , the compute server128A that received the request selects an egress IP address to use basedon the determined geolocation of the client device 110 and thegeolocation to egress IP mapping 150. The compute server 128A transmitsthe request 184 to the origin server 132 that uses the selected egressIP address as the source IP address.

In an embodiment, the egress IP addresses may be anycast IP addressesand advertised by multiple or all the data centers 125A-N. If the egressIP addresses are anycast IP addresses, return traffic may be received atmultiple compute servers and/or multiple data centers. Thus, it ispossible that traffic sent from a compute server and/or data centeroriginating a connection may not receive the response traffic directlyfrom the origin (instead the traffic could arrive at a different computeserver and/or data center due to the different compute server beingcloser to the origin than the originating compute server according to ananycast implementation). The response traffic may be forwarded from thedifferent compute server to the originating compute server for furtherprocessing and transmission back to the requesting client.

For instance, as illustrated in FIG. 1 , the origin server 132 transmitsthe response 186 that has a destination IP address as the selectedegress IP address. However, the response 186 is received at a computeserver 128N of the data center 125N instead of the compute server 128Athat transmitted the request due to the selected egress IP address beingan anycast IP address. Since the compute server 128N did not originatethe connection, the compute server 128N forwards the response to thecompute server 128A at operation 188. The compute server 128A receivesthis response and transmits the response to the client networkapplication 115 at operation 190. The compute server 128N may performfiltering such as distributed denial of service (DDoS) mitigation, or anetwork-level firewall, before forwarding traffic to compute server128A.

In an embodiment, the egress IP addresses and port space is split acrosscompute servers, data centers, and/or data center groups dynamically. Asystem of record (SOR) can be used for determining the appropriateegress IP address and port. For instance, a control process running in adata center may consult the SOR to determine the egress IP address andport to allocate and/or use. The SOR can be hierarchical.

FIG. 2 illustrates an example hierarchy of the system of record. The toplayer of the hierarchy is the data center group layer 260. The datacenters of the distributed cloud computing network 120 are organizedinto one or more data center groups that each include one or more datacenters. A data center group may be organized in several ways such as bygeolocation and/or data center type. As an example, a data center groupmay be defined for data centers in the United States and a data centergroup may be defined for data centers in Europe. As illustrated in FIG.2 , there are three data center groups 212A-C, respectively. The numberof data center groups is exemplary as there may be more or fewer groups.Each data center group advertises one or more IP subnets (e.g., a /24subnet). In the example shown in FIG. 2 , the data center group 212Aadvertises the IP subnet(s) 214A, the data center group 212B advertisesthe IP subnet(s) 214B, and the data center group 212C advertises the IPsubnet(s) 214C. The IP subnets may be anycast IP addresses. Theassignment of subnet to data centers may be relatively constant (e.g.,changing no more often than weekly). Thus, the data center group layer260 represents an IP address subnet level.

The second layer of the hierarchy is the data center layer 265. Withineach group of data centers, each data center is assigned one or moreegress IP addresses (e.g., one or more /32 IP addresses) from the IPsubnet advertised by the group. In an embodiment, the assigned one ormore IP addresses are approximated to the location of the data center.For instance, a data center in California may be assigned one or more IPaddresses that are mapped to a geographic location in or nearCalifornia. In another embodiment, the assigned one or more egress IPaddresses are not necessarily approximated to the location of the datacenter. For instance, a data center in California may be assigned one ormore IP addresses that are mapped to a geographic location in Europe. Asillustrated in FIG. 2 , the data center group 212A includes the datacenter 220 and the data center 222. The number of data centers in agroup is exemplary and there may be more or fewer data centers in anygroup. The data center 220 is assigned the IP address(es) 230 and thedata center 222 is assigned the IP address(es) 232. The IP addressassignment is stored in a group database that is available to the datacenters of the group. The IP address assignment may change morefrequently than the subnet mapping. For example, the IP address to datacenter mapping may change hourly and may have a synchronization latencyon the order of minutes. Thus, the data center layer 265 represents aspecific IP address level.

The third layer of the hierarchy is the compute server layer 270. Eachcompute server of the data center reserves a port range on a specificdata center allocated egress IP address. Port range can be reserved inblocks of a predefined amount (e.g., 1000 ports). The ports on aspecific address do not overlap within the data center. For instance, afirst compute server within the data center may be allocated ports10000-10999 on a specific IP address and a second compute server withinthe data center may be allocated ports 11000-11999 on the same IPaddress. As illustrated in FIG. 2 , the compute server 240 reserves theport range 250, the compute server 242 reserves the port range 252, thecompute server 244 reserves the port range 254, and the compute server246 reserves the port range 256. The reserved port range allocations arestored in a database. The port range allocations change more frequentlythan the IP address assignment. For example, the port range allocationsmay change on the order of minutes (e.g., 15 minutes) and may have asynchronization latency of seconds. Thus, the compute server layer 270represents a specific IP address level.

The following data may be globally known in the distributed cloudcomputing network: the list of IP subnet to data center assignment, themapping of geolocations to egress IP addresses, and a list of datacenters for each data center group. The following data may be known atthe data center group level: the IP address(es) assigned to each datacenter (which may also include a lease expiration). The following datamay be known at the data center level: the IP address and port rangeassigned to each compute server (which may also include a leaseexpiration).

In an embodiment, the determination of which egress IP to select isperformed with an API where given the determined location (e.g.,country, city, geohash, radius) of the originator of the traffic (e.g.,based on IP address), a best fitting egress IP address is returned(e.g., ordered by distance, ordered by country and then distance,ordered by country, city, and then distance). The API may also be usedfor determining the compute server that will process the egress trafficand the return traffic. For instance, given a subnet, the API may beable to return: the IP/port-range lease assigned to the querying computeserver; the IP address (e.g., /32 IP address) allocated to the localdata center with free ports; a list of internal IP addresses of anothercompute server in the current data center owning leases; a non-allocatedIP address (e.g., a /32 IP address) belonging to the current data centergroup; a list of data centers in the current data center group alreadyowning IP address(es) from the selected subnet; and the data centergroup that owns the appropriate IP.

FIG. 3 is a flow diagram that illustrates exemplary operations forselecting an egress IP address for use in outgoing traffic in adistributed cloud computing network according to an embodiment. Atoperation 305, egress IP addresses are mapped to one or more groupings.As an example, the egress IP addresses may be mapped to one or more ofthe following: geographic locations (e.g., countries, regions, cities,latitude/longitude, zones of population using specific dominantlanguage, etc.), organization (e.g., company 1 employees, company 2employees), bot likelihood, trusted vs untrusted traffic, quality ofservice to be applied to the traffic, mobile vs non-mobile clientdevice, manufacturer of client device, and/or priority level of thetraffic. The map may be published or otherwise made available todestinations external to the distributed cloud computing network (e.g.,origin networks).

Next, at operation 310, a compute server receives traffic destined for adestination external to the distributed cloud computing network. Forexample, a request may be received from a client device that isaddressed to a network location handled by an origin server outside ofthe distributed cloud computing network. The request may be received ata VPN server over a tunnel from a VPN client that is executing on theclient device.

Next, at operation 315, the compute server determines characteristic(s)applicable for the mapping. For instance, the compute server determinescharacteristic(s) of the users responsible for the traffic,characteristic(s) of the client devices transmitting the traffic,characteristic(s) of the client network applications being used on theclient devices transmitting the traffic, and/or characteristic(s) of theingress traffic itself. As an example, if the mapping is togeolocations, the compute server determines the geolocation of thereceived traffic. The compute server may access a public geolocationdatabase to determine the geolocation of the request based on the sourceIP address of the request. As another example, if the client device canprovide location services (e.g., through use of GPS or othergeolocation), the compute server may request the client device provideits location and/or otherwise receive the location data from the clientdevice. As another example, if the mapping is to an entity, the computeserver determines the entity to which the traffic is attributed (e.g.,by examining the HTTP host header, SNI, etc.).

Next, at operation 320, the compute server selects an IP address to useas the source IP address for outgoing traffic based on the determinedcharacteristic(s) and the mapped IP addresses to groupings. Forinstance, if the mapping is to geolocations, the compute server selectsan IP address to use as the source IP address for outgoing traffic basedon the geolocation of the received traffic and the mapped IP addressesto geographic locations. For instance, a geohash of the determinedlocation of the received traffic and a geohash of the mapped geographiclocations are compared. In an embodiment, the selection of the egress IPaddress is based on distance. For example, the egress IP address that isselected corresponds to the closest geohash of the mapped geographiclocations with the geohash of the determined location of the traffic. Inanother embodiment, the selection of the egress IP address is based onjurisdiction, which may not be the closest in terms of distance. Forexample, a client device located near the Northern Ireland border may begeographically closer to an egress IP address in Ireland, but theselected egress IP address is an IP address mapped to a UK location. Asanother example, the cities of Montreal and Ottawa are geographicallyclose, but the default languages are different (e.g., French and Englishrespectively). The jurisdiction-locality may then take precedence overdistance in selecting the egress IP address. After the egress IP addressis selected, at operation 325 the traffic is transmitted to the externaldestination using the selected egress IP address as the source IPaddress of the traffic.

In an embodiment, the compute server that transmits the traffic to theexternal destination may be different from the compute server thatreceives the traffic. For example, the selected egress IP address maynot be allocated to the compute server that received the traffic. Asanother example, the compute server that receives the traffic may nothave an allocated port. In an embodiment, after determining what egressIP address to use, the particular compute server for transmitting theegress traffic is determined.

The compute server that receives the incoming traffic may access thesystem of record to determine the geolocated IP/port-range that isallocated to a particular compute server. It is possible that thecompute server that receives the traffic has an available port for theegress IP. For example, with reference to FIG. 2 , if the compute server240 receives a request and the IP address 1.2.3.1 is selected as theegress IP address and one of the ports 10000-10999 is available, thecompute server 240 may use one of the available ports and transmit therequest to the destination origin server. However, if the compute server240 receives a request and does not have an available port for theselected IP address, the compute server 240 may determine if anavailable port is available on a different compute server (e.g., thecompute server 242). If that other compute server has an available portfor the selected IP address, the receiving compute server will forwardthe traffic to the other compute server within the same data center(e.g., the compute server 240 forwards the traffic to the compute server242). There may be cases where no compute servers in the data centerthat received the traffic are allocated the selected egress IP addressbut another data center in the group has the allocated address and/orport. For instance, if the compute server 240 receives the traffic andthe selected egress IP address is the address 1.2.3.2 (allocated to thecompute servers 244 and 246 of the data center 222), the compute server240 may determine to which data center the egress IP address has beenallocated (which in this example is the data center 222) and may thenquery that data center for a compute server that has the allocation. Forinstance, the compute server 240 may determine that the compute server244 has an allocated port for the selected IP address 1.2.3.2. In such acase, the compute server 240 forwards the traffic to the compute server244 for further processing. Also, there may be cases where no other datacenter in the data center group has the appropriate egress IP allocation(e.g., the data center may not be allocated the subnet). For instance,if the compute server 240 receives the traffic and the selected egressIP address is the address 2.3.4.1, the compute server 240 may determineto which data center group has been allocated that subnet (which is thedata center group 212B), and which data center has been allocated thespecific IP address, and then querying the specific data center that forwhich compute server has an allocated port.

Thus, in some cases, a series of operations are performed to determinewhat compute server is to transmit the egress traffic. It is thereforepossible that the local compute server that receives theconnection/packets will forward the connection/packets to anothercompute server because it does not have the appropriate egress IPallocation locally.

As previously described, in some embodiments the egress IP addresses areanycast IP addresses. As a result, it is possible that traffic sent froma compute server and/or data center originating a connection may notreceive the response traffic directly from the origin (instead thetraffic could arrive at a different compute server and/or data centerdue to the different compute server being closer to the origin than theoriginating compute server according to an anycast implementation). Theresponse traffic may be forwarded from the different compute server tothe originating compute server for further processing and transmissionback to the requesting client.

FIG. 4 is a flow diagram that illustrates exemplary operations forprocessing return traffic at the distributed cloud computing networkaccording to an embodiment. At operation 410, a first compute server ofthe distributed cloud computing network receives traffic that has adestination IP address as a selected egress IP address of thedistributed cloud computing network. Next, at operation 415, the firstcompute server determines whether it is capable of processing thereceived traffic. For instance, the first compute server may determinewhether it originated the traffic (e.g., by determining if it has beenallocated the IP address and port). If the first compute server iscapable of processing the received traffic, then the first computeserver processes the received traffic at operation 420 and transmits thetraffic to the requesting client device at operation 430. If the firstcompute server is not capable of processing the traffic, then the firstcompute server transmits the received traffic to another compute serverfor processing the received traffic at operation 425.

Like when determining what compute server is to transmit the egresstraffic, a series of operations may be performed for determining whatcompute server transmitted the egress traffic and therefore shouldprocess the return traffic (if any). The compute server that receivesthe return traffic may access the system of record to determine thegeolocated IP/port-range that is allocated to a particular computeserver. For instance, if the compute server 240 receives a return packetthat is addressed to the IP address 1.2.3.1 and port that falls in therange of 10000-10999, the compute server 240 may process the returntraffic including transmitting the return traffic to the originatingclient device. However, if the compute server 240 receives a returnpacket that is addressed to the IP address 1.2.3.1 with a port thatfalls in the range of 11000-11999, the compute server 240 was not theoriginator of the traffic. If the traffic is addressed to an unallocatedIP address or to an unallocated port/rage, the compute server may dropthe packet. The compute server then determines that the compute server242 has an appropriate port range and forwards the return packet to thecompute server 242 for further processing. As another example, if thecompute server 240 receives a return packet that is addressed to an IPaddress that is not one of the IP address(es) 230 allocated to the datacenter 220, the compute server 240 determines to which data center theIP address is allocated. For instance, if the return packet is addressedto the IP address 1.2.3.2, the compute server 240 determines that the IPaddress is allocated to the data center 222. The compute server 240 mayquery the data center 222 for a compute server that has the IPaddress/port allocation and then forward the packet to that computeserver for further processing. As another example, if the compute server240 receives a return packet that is addressed to an IP address that isnot one of the allocated IP subnet(s) 214A for the data center group212A (e.g., the IP address is 2.3.4.1), the compute server 240 maydetermine to which data center group has been allocated that subnet(which is the data center group 212B), and which data center has beenallocated the specific IP address, and then querying the specific datacenter that for which compute server has an allocated port. The computeserver may then forward the packet to that compute server for furtherprocessing.

FIG. 5 illustrates a system for proxying outbound layer 4 connectionsfrom anycast IP addresses in a distributed cloud computing networkaccording to an embodiment. The distributed cloud computing network 120is like the network shown in FIG. 1 . However, unlike the systemillustrated in FIG. 1 , in the example of FIG. 5 , the entry computeserver (e.g., a compute server 128A) proxies L4 traffic destined to theorigin server 132 to an exit compute server and/or data center (e.g., acompute server 128N of the data center 125N). This is because for theselected egress IP address, which is an anycast IP address, the computeserver(s) 128N are the closest in terms of routing protocolconfiguration according to an anycast implementation to the originserver 132 out of the compute server(s) 128A-N of the data centers125A-N. The L4 connection is created between a compute server 128N andthe origin server 132 and the L4 state is stored at the data center125N.

The client network application 115 transmits traffic 580 that isreceived at one of the compute server(s) 128A of the data center 125A.The traffic 580 may be transmitted over a VPN tunnel established betweenthe client device 110 and the compute server 128A. The traffic 580 isdestined for a destination that is external to the distributed cloudcomputing network 120 (e.g., a destination handled by the origin server132). The destination IP address of the traffic 580 may be an anycast IPaddress that is advertised at multiple ones of the data centers 125A-N.The traffic 580 may be received at the data center 125A out of the datacenters 125A-N because that data center is closest to the client device110 in terms of routing protocol configuration (e.g., Border GatewayProtocol (BGP) configuration) according to an anycast implementation asdetermined by the network infrastructure (e.g., router(s), switch(es),and/or other network equipment) between the client device 110 and thedata centers 125A-N.

The compute server 128A that receives the incoming traffic 580determines the geographic location of that incoming traffic 580. Forexample, the compute server 128A may access the public geolocationdatabase 160 to determine the geolocation of the traffic based on thesource IP address of the traffic. As another example, if the clientdevice can provide location services (e.g., through use of GPS or othergeolocation), the compute server 128A may request the client device 110provide its location and/or otherwise receive the location data from theclient device 110. To prevent the tunnel client 117 from forging suchparameters, the compute server 128A may require cryptographicauthentication of sensor information from the client device operatingsystem or hardware.

Outgoing traffic from the distributed cloud computing network 120 mayhave different source IP addresses than incoming traffic. For instance,instead of forwarding the traffic 580 from the client device 110 withthe source IP address of the client device, the traffic that isforwarded to the origin server 132 may use an egress IP address (an IPaddress of the distributed cloud computing network 120). Like asdescribed in the example of FIG. 1 , the compute server 128A, atoperation 582, selects an egress IP address or an egress IP subnet(e.g., a /24 subnet) based on the determined location of the requesterand the geolocation to egress IP mapping 150. For instance, a geohash ofthe determined location of the requester and a geohash of the mappedgeographic locations are compared. The egress IP address or subnet thatcorresponds to the closest or otherwise preferred geohash of the mappedgeographic locations with the geohash of the determined location of therequester may be chosen.

The compute server(s) 128A-N include the exit discovery component 152.The exit discovery component 152 determines the exit data center (out ofthe data centers 125A-N) for any external host, such as the externalhost handled by the origin server 132. The exit discovery component 152has access to the exit mapping 153A that identifies the exit data center(out of the data centers 125A-N) for a given origin subnet and theselected egress subnet. If there is not an entry for the given originsubnet and the selected egress subnet in the exit mapping 153A, adiscovery process is performed to discover the exit data center.

The discovery process includes transmitting a discovery probe. Using TCPas an example, the compute server 128A that receives the traffic 580transmits a TCP SYN packet to the external host, which in this examplecorresponds to the origin network 130. This TCP SYN packet uses as itssource IP address the selected egress IP address or address from theselected egress IP subnet, which is an anycast IP address. The TCP SYNpacket is received at the origin and causes a TCP SYN-ACK to be sent bythe origin. The TCP SYN-ACK packet is destined to the source IP addressof the TCP SYN packet which is an anycast IP address that is advertisedat multiple data centers of the data centers 125A-N. Accordingly, thedata center of the data centers 125A-N that receives the TCP SYN-ACKpacket is the closest to the origin server (at least with respect to thetransmitting compute server) in terms of routing protocol configuration(e.g., BGP configuration) according to an anycast implementation. Thisdata center is also likely to receive other traffic addressed to theselected egress IP address. Accordingly, this data center is mapped asthe exit data center at least with respect to the transmitting computeserver. If, for example, the compute server 128A receives thecorresponding TCP SYN-ACK packet from the origin, then the exit datacenter is the data center 125A.

Since the source IP address of the TCP SYN packet is an anycast IPaddress that is advertised at multiple data centers, it is possible thatthe TCP SYN-ACK packet will be received at a different data center fromthe one that transmitted the TCP SYN packet. In such a case, in anembodiment the receiving data center gossips or broadcasts to the otherdata centers that it is receiving traffic from the origin subnetaddressed to the selected anycast-egress subnet. The data center thattransmitted the TCP SYN packet uses this information to learn the exitdata center for the origin subnet and selected anycast-egress subnetpair and populate the exit mapping. For instance, in the example of FIG.5 , the data center 125N is the exit data center for the origin subnethandled by the origin server 132 for the selected anycast-egress subnet.After receiving the gossip from the receiving data center (the exit datacenter), the transmitting data center reattempts to connect to theexternal host by proxying its connection through a layer-4 proxy in theexit data center. In an embodiment, the TCP SYN packet for the discoveryprobe uses a dedicated source port (e.g., 9999) outside of the range ofthe ephemeral port range. This prevents a case where the receiving datacenter happens to use the same port number as the discovery probe forother connections.

In another embodiment, each compute server and/or each data center hastheir own dedicated port used for discovery probes. In such anembodiment, if a receiving data center receives a TCP SYN-ACK packetaddressed to that port, it will know which compute server and/or datacenter transmitted the TCP SYN packet that caused the TCP SYN-ACK packetto be sent. Instead of gossiping or broadcasting to other data centers,the receiving data center may transmit an indication that it isreceiving traffic from the origin subnet addressed to the selectedanycast-egress subnet to the particular compute server and/or datacenter that belongs to the discovery probe. In an embodiment, within thedata center that receives the result of the discovery probe, the resultmay be broadcasted to the other compute servers within that data centerso that each may learn of the exit data center mapping.

In another embodiment, the compute server of the entry data center thattransmits the discovery probe also broadcasts information to the otherdata centers that indicates it is transmitting the discovery probe andthe expected ports and sequence number of the reply packet. A computeserver in an exit data center can then match the probe reply packet witha recently received indication that the discovery probe was made andthen broadcast, gossip, or directly send a probe-success back to theentry data center when a match is made.

It is possible that the IP address of the origin is also an anycast IPaddress that is advertised by multiple network elements. In such a case,there may be multiple exit data centers for a particular origin subnetand anycast-egress subnet pair. In an embodiment, the exit mapping iskept only on a per-data center basis or at a regional data center basis.For instance, the exit mapping 153A may be different from the exitmapping 153N.

Referring back to the example of FIG. 5 , the exit discovery component152 of the compute server 128A determines the exit data center for theorigin subnet and selected anycast-egress subnet pair at operation 584.For instance, the exit discovery component 152 accesses the exit mapping153A to determine if there is a mapping of an exit data center for theorigin subnet and the selected anycast-egress subnet pair. If there is,that data center is used as the exit data center. If there is not, thenthe exit discovery component 152 performs the discovery process asdescribed herein. In the example of FIG. 5 , the exit discoverycomponent 152 determines that the exit data center for the destinationof the ingress traffic 580 and the selected anycast-egress subnet pairis the data center 125N.

After determining the data center 125N is the exit data center, thecompute server 128A proxies the traffic through a layer 4 proxy in theexit data center at operation 586. The exit data center may includemultiple compute servers each of which may be able to make the L4connection with the origin. The exit data center is configured such thatthe same compute server processes the traffic for the initial L4connection with the origin, the return traffic from the origin, and anyfurther incoming traffic from the client device 110.

For instance, in an embodiment, each compute server of a data center isassigned a unique /32 IP address out of a larger IP address prefix(e.g., /23 or /22 subnet) for the anycast-egress IP subnets, and thosecompute servers do not advertise the larger IP address prefix butinstead advertise the unique /32 IP address. The router or other pieceof network equipment in the compute server may advertise the larger IPaddress prefix. In such a case, a router or other piece of networkequipment of the data center may select one of the compute servers thatis to serve as the layer 4 proxy with its unique /32 IP address, whichcan then be used to identify which compute server is processing thetraffic. The selection may be based on round-robin, least recently used,depending on load, or other selection.

In another embodiment, fewer than all the compute servers of a datacenter are assigned a unique /32 IP address. These compute servers donot advertise the larger IP address prefix but instead advertise theirunique /32 IP address. The router or other piece of network equipment inthe compute server may advertise the larger IP address prefix. In such acase, a router or other piece of network equipment of the data centermay select one of the compute servers that is to serve as the layer 4proxy. If a compute server that is not allocated a unique /32 IP addressis selected, that compute server may itself proxy their connections withone of the compute servers that are allocated a unique /32 IP address.

In another embodiment, each compute server of the data center reserves aport range on a specific data center allocated egress IP address. Theports on a specific address do not overlap within the data center. Forinstance, a first compute server within the data center may be allocatedports 10000-10999 on a specific IP address and a second compute serverwithin the data center may be allocated ports 11000-11999 on the same IPaddress. A system of record (SOR) can be used for determining the egressIP address and port mapping. For instance, a control process running ina data center may consult the SOR to determine which compute server toforward traffic based on the port.

At operation 588, the compute server 128N of the exit data center 125Ntransmits the egress traffic to the origin server 132. The egresstraffic has the selected egress IP address as the source IP address. Theorigin server 132 processes the egress traffic and may transmit returntraffic. The return traffic is addressed to the selected egress IPaddress, which as previously described is an anycast IP address. Becausethe traffic for this connection was sent to the origin server from thedetermined exit data center, it is likely that the return traffic willbe received at the data center 125N, which is shown in operation 590. Insuch a case, the return traffic is processed by the compute server 128Nof the data center 125N that sent the egress traffic to the originserver. For instance, if the compute servers 128N are allocated a unique/32 IP address out of the larger IP address prefix for theanycast-egress IP subnet, the router of the data center 125N maytransmit the return traffic directly to the compute server 128N that isassigned the IP address to which the return traffic is addressed. Asanother example, a control process may access a SOR to determine whichcompute server 128N to forward the return traffic based on the port.

The compute server 128N processes the return traffic and may forward thereturn traffic to the entry compute server (e.g., a compute server 128A)at operation 592. The entry compute server receives the traffic andtransmits the traffic to the client network application 115 at operation594.

FIG. 6 is a flow diagram that illustrates exemplary operations forproxying L4 connections between an entry compute server and an exitcompute server in a distributed cloud computing network according to anembodiment. At operation 605, egress IP addresses are mapped to one ormore groupings. The operation 605 is like the operation 305 describedherein. As an example, the egress IP addresses may be mapped to one ormore of the following: geographic locations (e.g., countries, regions,cities, latitude/longitude, zones of population using specific dominantlanguage, etc.), organization (e.g., company 1 employees, company 2employees), bot likelihood, trusted vs untrusted traffic, quality ofservice to be applied to the traffic, mobile vs non-mobile clientdevice, manufacturer of client device, and/or priority level of thetraffic. The map may be published or otherwise made available todestinations external to the distributed cloud computing network (e.g.,origin networks).

Next, at operation 610, a compute server receives traffic associatedwith a destination external to the distributed cloud computing network.The traffic may be, for example, an HTTP/S request for content from theorigin server. The traffic may be received at a VPN server over a tunnelfrom a VPN client that is executing on the client device. Thedestination IP address of the incoming traffic may be an anycast IPaddress that is advertised by each of the data centers 125A-N and theparticular data center that receives the traffic may be determined bythe network infrastructure according to an anycast implementation.Alternatively, the destination IP address of the traffic may be aunicast IP address that is assigned to the particular compute serverthat received the packet and selected by a geographical load balancer.The destination IP address of the traffic may be associated with theorigin or may belong to the origin and advertised at the data centerinstead of the origin.

Next, at operation 615, the compute server determines characteristic(s)applicable for the mapping. For instance, the compute server determinescharacteristic(s) of the users responsible for the traffic,characteristic(s) of the client devices transmitting the traffic,characteristic(s) of the client network applications being used on theclient devices transmitting the traffic, and/or characteristic(s) of theingress traffic itself. As an example, if the mapping is togeolocations, the compute server determines the geolocation of thereceived traffic. The compute server may access a public geolocationdatabase to determine the geolocation of the traffic based on the sourceIP address of the traffic. As another example, if the client device canprovide location services (e.g., through use of GPS or othergeolocation), the compute server may request the client device provideits location and/or otherwise receive the location data from the clientdevice. As another example, if the mapping is to an entity, the computeserver determines the entity to which the traffic is attributed (e.g.,by examining the HTTP host header, SNI, etc.).

Next, at operation 620, the compute server selects an IP address to useas the source IP address for outgoing traffic based on the determinedcharacteristic(s) and the mapped IP addresses to groupings. Forinstance, if the mapping is to geolocations, the compute server selectsan IP address to use as the source IP address for outgoing traffic basedon the geolocation of the received traffic and the mapped IP addressesto geographic locations. For instance, a geohash of the determinedlocation of the received traffic and a geohash of the mapped geographiclocations are compared. In an embodiment, the selection of the egress IPaddress is based on distance. For example, the egress IP address that isselected corresponds to the closest geohash of the mapped geographiclocations with the geohash of the determined location of the traffic. Inanother embodiment, the selection of the egress IP address is based onjurisdiction, which may not be the closest in terms of distance. Forexample, a client device located near the Northern Ireland border may begeographically closer to an egress IP address in Ireland, but theselected egress IP address is an IP address mapped to a UK location. Asanother example, the cities of Montreal and Ottawa are geographicallyclose, but the default languages are different (e.g., French and Englishrespectively). The jurisdiction-locality may then take precedence overdistance in selecting the egress IP address. The selected IP address isan anycast IP address that is advertised at multiple data centers.

Next, at operation 625, the compute server determines the exit datacenter for the origin IP address and selected egress IP address pair.For instance, the compute server may access a data structure thatassociates data centers with origin IP addresses and egress IP addressesto determine if there is an exit data center already known for theorigin IP address and selected egress IP address pair. If there is not aknown exit data center for the origin IP address and selected egress IPaddress pair, the compute server performs a discovery process todetermine the exit data center. The discovery process may be the same asdescribed herein.

If the exit data center is the data center of which the compute serveris part, then the compute server transmits the traffic to the externaldestination using the selected egress IP address as the source IPaddress of the traffic. If the exit data center is a different datacenter, then the compute server proxies the traffic to the differentdata center at operation 630. A compute server in that different datacenter transmits the traffic to the external destination using theselected egress IP address as the source IP address of the traffic. Theexit compute server may receive return traffic from the externaldestination and proxy that traffic to the compute server. Thus, atoperation 635, the compute server receives return traffic from thedifferent data center. The compute server transmits the return trafficto the requesting client device at operation 640.

Since the selected egress IP address is an anycast IP address that isadvertised by multiple data centers, it is possible that a data centerdifferent from the determined exit data center receives return trafficfor a particular connection. In such a case, that data center may not beable to process the traffic as it does not have knowledge of theunderlying connection. For instance, if the data center receives a TCPpacket belonging to a connection that it did not establish, theconnection may be dropped. As previously described, it is possible thatthere are multiple exit data centers for a particular origin subnet andanycast-egress subnet pair. In an embodiment, if a server in a datacenter receives a packet for a connection which it does not have localstate but is one of the exit data centers for the origin subnet andanycast-egress subnet pair, that server will broadcast the packet or thepacket's state (e.g., the packet's connection tuple and other connectioninformation such as the sequence number) to other known exit datacenters for the packet. The data center and/or compute server thatreceives such a broadcast checks whether that packet matches anestablished connection. If so, that data center and/or compute serverreplies to the compute server and/or data center that broadcasts theinformation so that further packets for the connection will be directlyforwarded to the data center and/or compute server that has theestablished connection.

In an embodiment, upon a data center receiving reply packets that it didnot initiate, that data center gossips or broadcasts to the other datacenters that it is receiving traffic for that connection. In anotherembodiment, if the receiving data center is able to determine whichother data center and/or compute server to which the traffic belongs, itmay forward the traffic to that other data center and/or compute server.That other data center and/or compute server may broadcast or gossipthat it is no longer the correct exit data center, which may be doneafter verifying that the traffic it receives matches an establishedconnection. This broadcast or gossip causes new discovery probes to besent for new connections.

Although embodiments described herein have described the egress IPaddress selected based on a mapping of characteristics of the requestingclient devices, in an embodiment the egress IP address is not selectedin this fashion. In such an embodiment, an exit data center and/orcompute server of a distributed cloud computing network is determinedfor the pair of the origin IP address and egress IP address. The egressIP address may be an anycast IP address. The L4 connection will beproxied from an entry compute server to an exit compute server in theexit data center. The exit compute server makes the L4 connection withthe origin. Thus, outbound connections from the distributed cloudcomputing network to any external host can be made with anycast allowingfor improved latency while reducing IP space.

FIG. 7 illustrates a system for proxying L4 connections between an entrycompute server and an exit compute server in a distributed cloudcomputing network according to an embodiment. The distributed cloudcomputing network 120 is like the network shown in FIG. 5 . However,unlike the system illustrated in FIG. 5 , in the example of FIG. 7 theegress IP address is not selected based on characteristic(s) of theinbound client device, characteristic(s) of the user associated with theinbound internet traffic, characteristic(s) of the inbound clientnetwork application, and/or characteristic(s) of the inbound internettraffic. The egress IP address is an anycast IP address that is sharedamong multiple compute servers of the distributed cloud computingnetwork 120 according to an embodiment. The egress IP address may beselected from multiple possible IP addresses. The selection may be basedon round-robin, least recently used, or other selection technique notbased on the characteristic(s) described above. In an embodiment, the IPaddress from which the incoming traffic is addressed is the same IPaddress used for the egress IP address.

The client network application 115 transmits traffic 780 that isreceived at one of the compute server(s) 128A of the data center 125A.The traffic 780 may be transmitted over a VPN tunnel established betweenthe client device 110 and the compute server 128A. The traffic 780 isdestined for a destination that is external to the distributed cloudcomputing network 120 (e.g., a destination handled by the origin server132). Outgoing traffic from the distributed cloud computing network 120may have different source IP addresses than incoming traffic. Forinstance, instead of forwarding the traffic 580 from the client device110 with the source IP address of the client device, the traffic that isforwarded to the origin server 132 uses an egress IP address (an IPaddress of the distributed cloud computing network 120). The egress IPaddress is an anycast IP address according to an embodiment.

Like as described with reference to FIG. 5 , the exit discoverycomponent 152 determines the exit data center (out of the data centers125A-N) for any external host, such as the external host handled by theorigin server 132. The exit discovery component 152 has access to theexit mapping 153A that identifies the exit data center (out of the datacenters 125A-N) for a given origin subnet and the selected egresssubnet. If there is not an entry for the given origin subnet and theselected egress subnet in the exit mapping 153A, a discovery process isperformed to discover the exit data center, as previously described.Thus, at operation 784, the exit discovery component 152 of the computeserver 128A determines the exit data center for the origin subnet andthe anycast-egress subnet pair. For instance, the exit discoverycomponent 152 accesses the exit mapping 153A to determine if there is amapping of an exit data center for the origin subnet and theanycast-egress subnet pair. If there is, that data center is used as theexit data center. If there is not, then the exit discovery component 152performs the discovery process as described herein. In the example ofFIG. 7 , the exit discovery component 152 determines that the exit datacenter for the destination of the ingress traffic 780 and theanycast-egress subnet pair is the data center 125N.

After determining the data center 125N is the exit data center, thecompute server 128A proxies the traffic through a layer 4 proxy in theexit data center at operation 786. The exit data center may includemultiple compute servers each of which may be able to make the L4connection with the origin. The exit data center is configured such thatthe same compute server processes the traffic for the initial L4connection with the origin, the return traffic from the origin, and anyfurther incoming traffic from the client device 110.

For instance, in an embodiment, each compute server of a data center isassigned a unique /32 IP address out of a larger IP address prefix(e.g., /23 or /22 subnet) for the anycast-egress IP subnets, and thosecompute servers do not advertise the larger IP address prefix butinstead advertise the unique /32 IP address. The router or other pieceof network equipment in the compute server may advertise the larger IPaddress prefix. In such a case, a router or other piece of networkequipment of the data center may select one of the compute servers thatis to serve as the layer 4 proxy with its unique /32 IP address, whichcan then be used to identify which compute server is processing thetraffic. The selection may be based on round-robin, least recently used,depending on load, or other selection.

In another embodiment, fewer than all the compute servers of a datacenter are assigned a unique /32 IP address. These compute servers donot advertise the larger IP address prefix but instead advertise theirunique /32 IP address. The router or other piece of network equipment inthe compute server may advertise the larger IP address prefix. In such acase, a router or other piece of network equipment of the data centermay select one of the compute servers that is to serve as the layer 4proxy. If a compute server that is not allocated a unique /32 IP addressis selected, that compute server may itself proxy their connections withone of the compute servers that are allocated a unique /32 IP address.

In another embodiment, each compute server of the data center reserves aport range on a specific data center allocated egress IP address. Theports on a specific address do not overlap within the data center. Forinstance, a first compute server within the data center may be allocatedports 10000-10999 on a specific IP address and a second compute serverwithin the data center may be allocated ports 11000-11999 on the same IPaddress. A system of record (SOR) can be used for determining the egressIP address and port mapping. For instance, a control process running ina data center may consult the SOR to determine which compute server toforward traffic based on the port.

At operation 788, the compute server 128N of the exit data center 125Ntransmits the egress traffic to the origin server 132. The egresstraffic has the egress IP address as the source IP address. The originserver 132 processes the egress traffic and may transmit return traffic.The return traffic is addressed to the egress IP address, which aspreviously described is an anycast IP address. Because the traffic forthis connection was sent to the origin server from the determined exitdata center, it is likely that the return traffic will be received atthe data center 125N, which is shown in operation 790. In such a case,the return traffic is processed by the compute server 128N of the datacenter 125N that sent the egress traffic to the origin server. Forinstance, if the compute servers 128N are allocated a unique /32 IPaddress out of the larger IP address prefix for the anycast-egress IPsubnet, the router of the data center 125N may transmit the returntraffic directly to the compute server 128N that is assigned the IPaddress to which the return traffic is addressed. As another example, acontrol process may access a SOR to determine which compute server 128Nto forward the return traffic based on the port.

The compute server 128N processes the return traffic and may forward thereturn traffic to the entry compute server (e.g., a compute server 128A)at operation 792. The entry compute server receives the traffic andtransmits the traffic to the client network application 115 at operation794.

Although FIG. 7 shows an embodiment where outgoing traffic from thedistributed cloud computing network 120 is sent because of incomingtraffic being received from an external device (e.g., the client networkapplication 115), embodiments are not so limited. For instance, aninternal program running in a data center of the distributed cloudcomputing network 120 may make an external connection on its own accord.For instance, a caching program executing in the distributed cloudcomputing network may asynchronously access external websites to fillthe cache. In such an example, the IP address(es) that are used may beanycast IP addresses that are shared by multiple compute servers and/ordata centers. Thus, in an embodiment, regardless of the cause of theexternal connection, if an external connection is to be made from aserver of the distributed cloud computing network that uses an anycastIP address as the source IP address, the exit data center is determinedfor the external destination IP address and the anycast IP address pair(e.g., as previously described) and the traffic is proxied to that exitdata center (if not the current data center).

FIG. 8 is a flow diagram that illustrates exemplary operations forproxying L4 connections between an entry compute server and an exitcompute server in a distributed cloud computing network according to anembodiment. At operation 810, a compute server receives a packetassociated with a destination external to the distributed cloudcomputing network. The destination IP address of the packet may be ananycast IP address that is advertised by each of the data centers 125A-Nand the particular data center that receives the packet may bedetermined by the network infrastructure according to an anycastimplementation. Alternatively, the destination IP address of the packetmay be a unicast IP address that is assigned to the particular computeserver that received the packet and selected by a geographical loadbalancer. The destination IP address of the packet may be associatedwith the origin or may belong to the origin and advertised at the datacenter instead of the origin.

Next, at operation 815, the compute server determines the exit datacenter for the packet. The determination may be for the pair of the IPaddress for the origin and the egress IP address. In an embodiment, theegress IP address is an anycast IP address that is shared among multiplecompute servers of the distributed cloud computing network. The egressIP may be selected from multiple possible IP addresses. The selectionmay be based on round-robin, least recently used, or other selectiontechnique not based on the characteristic(s) described above. In anembodiment, the IP address from which the incoming traffic is addressedis the same IP address used for the egress IP address. To determine theexit data center for the packet, the compute server may access a datastructure that associates data centers with origin IP addresses andegress IP addresses to determine if there is an exit data center alreadyknown for the origin IP address and selected egress IP address pair. Ifthere is not a known exit data center for the origin IP address andselected egress IP address pair, the compute server performs a discoveryprocess to determine the exit data center. The discovery process may bethe same as described herein.

If the exit data center is the data center of which the compute serveris part, then the compute server transmits the packet to the externaldestination using the selected egress IP address as the source IPaddress of the traffic. If the exit data center is a different datacenter, then the compute server proxies the traffic to the differentdata center at operation 820. A compute server in that different datacenter transmits the traffic to the external destination using theselected egress IP address as the source IP address of the traffic. Theexit compute server may receive return traffic from the externaldestination and proxy that traffic to the compute server. Thus, atoperation 825, the compute server receives return traffic from thedifferent data center. The compute server transmits the return trafficto the requesting client device at operation 830.

Although FIG. 8 shows an embodiment where a compute server receivestraffic that is associated with a destination external to thedistributed cloud computing network that causes an external connectionto be used to that external destination, embodiments are not so limited.For instance, the external connection can be triggered by an internalprogram running in a compute server. Thus, instead of operation 810where a compute server receives a packet, the compute server maydetermine to transmit outgoing packet to an external destination. If ananycast IP address is used for the outgoing traffic to the externaldestination, the compute server will determine the exit data center asdescribed in operation 815 and proxy the traffic as described inoperation 820 in an embodiment. Of course, if there is not a deviceoriginating the incoming traffic (e.g., a client device), operation 830does not need to be performed. Instead, the compute server receives thereturn traffic from the exit data center as in operation 825 andinternally processes the traffic. Thus, in an embodiment, regardless ofthe cause of the external connection, if an external connection is to bemade from a server of the distributed cloud computing network that usesan anycast IP address as the source IP address, the exit data center isdetermined for the external destination IP address and the anycast IPaddress pair (e.g., as previously, and the anycast IP address pair(e.g., as previously described) and the traffic is proxied to that exitdata center (if not the current data center).

The preceding description described a distributed cloud computingnetwork that performs various actions. The distributed cloud computingnetwork can provide one or more performance services and/or one or moresecurity services. The one or more performance services can include acontent delivery network, caching, video delivery, website optimizations(e.g., asynchronous loading, image optimizations, mobile optimizations),load balancing, intelligent routing, availability, and/or protocolmanagement (e.g., IPv4/v6 gateway). The one or more security servicescan include DDoS protection, secure session (SSL/TLS) support, webapplication firewall, threat blocking, privacy protection, accesscontrol, compliance, and/or rate limiting. The performance services andsecurity services described above are examples and the distributed cloudcomputing network may perform different services than described. In anembodiment, each performance service and/or security service can beperformed in each data center.

In an embodiment, the content delivery network service may includecaching content at the data centers 125A-N (e.g., the distributed cloudcomputing network 120) to deliver content faster with less latency. Inaddition, when static content is cached in the geographicallydistributed network of data centers, the availability of the staticcontent can be maintained even when the origin server fails or goesdown. In an embodiment, content caching is based on rules that specifyparticular behavior for individuals URLs and/or IP addresses, includingwhat content gets cached and how long the content remains cached.Traffic can be load balanced across multiple origins, using proximityand network latency to determine the most efficient destination for eachcontent request.

The content delivery network service may include video deliveryservices. In an embodiment, the video delivery services provide highquality video streaming through a bundled platform that combinesstorage, transcoding, distribution, and playback functionalities.

In an embodiment, caching service can include automatic static contentcaching, cache purging, and tiered caching. As noted above, staticcontent caching can conserve CPU resources and bandwidth providingstatic content from the geographically distributed network of datacenters. In an embodiment, cache purging services using cache-tagsstored as metadata with cached objects allows for purging an entirecache or a single file. In an embodiment, using tiered caching, contentserved from adjacent data centers can reduce cache-miss rates, serverload, and end-to-end latency.

Website optimization services can include asynchronous resource loading,image optimizations, and mobile optimizations. Asynchronous resourceloading can allow multiple resources (e.g., images, scripts, etc.) to beloaded simultaneously rather than sequentially. Image optimizations caninclude resizing images from a single-source image master based on atype of user device and a connection speed. Images can be manipulated bydimensions (e.g., screen size), compression ratios, and format (e.g.,WebP conversion where supported). Image optimizations can also includeapplying both “lossless” and “lossy” image optimizations to removeunnecessary bytes from images. Mobile optimizations can includedetecting a browser type of a user device and optimizing performance forthe particular type of user device. This can improve the performance ofimages when a website is accessed via a mobile connection.

The load balancing services may provide local and global load balancingto reduce latency by load balancing traffic across multiple servers orby routing traffic to the closest geolocation region. For example,requests for dynamic content are sourced from origin servers that areeither closest to the user or meet specific weighted requirements.

The load balancing services may also provide health checks of serverswith fast failover to rapidly route users away from failing servers. Forexample, through periodic HTTP/HTTPS requests, monitoring can beconfigured for specific URLs with customizable intervals, timeouts, andstatus codes. Availability monitoring can check the health of originservers (e.g., as often as every 15 seconds), with reporting via emailnotifications and a REST API. Thus, when an origin server is marked asunhealthy, multi-region failover can route or reroute traffic to thenext available healthy server.

Network congestion and unreliable connections can result in slow loadtimes of websites. To address these issues, intelligent routing servicescan use real-time network intelligence to route traffic through thefastest network paths, while maintaining open, secure connections toeliminate latency imposed by connection-setup. For example, based onnetwork conditions, requests can be routed to avoid congested networkpaths and/or unreliable connections.

Protocol management services include an IPv4-to-IPv6 translation gatewaythat can allow any website to be available over IPv6 even when a site'sorigin network does not yet support the IPv6 protocol. In an embodiment,services that require IPv4 support can use a Pseudo IPv4 service, wherean HTTP header is added to requests established over IPv6 with a“pseudo” IPv4 address. In such an embodiment, using a hashing algorithm,Pseudo IPv4 will create a Class E IPv4 address which will produce thesame output for the same input; the same IPv6 address will result in thesame Pseudo IPv4 address.

A DDoS detection and mitigation service detects and mitigates againstDDoS attacks. DDoS attacks may be identified in several ways that may bedifferent based on the type of attack. Many DDoS attacks involve sendinga large amount of traffic of a certain type to an intended target. TheDDoS detection may determine when there is an abnormal amount of trafficthat is destined to a particular destination (e.g., the traffic spikesfrom what is normally encountered). The DDoS detection may sample andanalyze the traffic looking for inconsistencies and establish athreshold amount of what the normal traffic rate is for a domain and/orIP address and determine when traffic exceeds that threshold. Trafficrates may be individual and separate for a compute server and/or datacenter and a DDoS attack may be identified for each separate computeserver and/or data center; or a DDoS can be identified through anaggregation of traffic across all compute servers and data centers. Byway of a specific example, a DDoS attack may be detected by using one ormore parameters that exceed a threshold, including one or more of thefollowing to a particular IP address and/or domain: the number ofpackets, the amount of bandwidth, the number of User Datagram Protocol(UDP) packets/second, the number of Transmission Control Protocol (TCP)packets/second, the number of connections opened, the number of failedconnections, and the ratio of successfully opened connections versusfailed connections. These are just examples as there may be otherparameters used in combination with, or in lieu of, the above to detecta DDoS attack. For example, the distributed cloud computing network 120may detect if a domain and/or IP address is unreachable due to a heavyload, which may be an indication of a DDoS attack. As another example,the detection of a spike in metrics pertaining to a page or a resourcerequest may be an indication of a DoS attack (e.g., a particular requestheader, cookie, size of the request, non-standard control characters,many GET parameters, a large number of POST parameters, etc.). The DDoSmitigation may create rules to filter packets that meet certain criteriaand install them in a firewall for dropping the packets.

Secure session support services (e.g., Secure Socket Layer (SSL) andTransport Layer Security (TLS) support) may be provided that allow forSSL to operate in different modes depending on the level of securityrequired and the amount of user configuration. For example, a flexiblesecure session service encrypts traffic from the distributed cloudcomputing network 120 to a client device, but not from the distributedcloud computing network 120 to an origin server, while a full securesession service encrypts the traffic from the distributed cloudcomputing network 120 to the origin server and the client device.

Web application firewall services can run in real-time to preventautomated attacks, SQL injection, XSS JavaScript injections and otherreal-time POST actions (e.g., cross-site scripting, cross-site forgeryrequests, etc.). The web application firewall services can contain rulesto thwart attacks commonly seen in popular applications, including:WordPress, Magento, Drupal, PHP, Joomla, etc. In an embodiment, webapplication firewall services allow an administrator to import their ownrules and write custom rules, as well as utilize system-generated rulesthat are automatically updated when new security vulnerabilities areidentified or detected.

Threat blocking and privacy protection security services can includereputation-based threat protection that block known malicious threats,comment spam protection that block spammers from posting on a website,and content scraping protection that protect content (e.g., text,images, email addresses) from web scrapers. Threat blocking securityservices can also block or present challenges to users by country, IPaddress, or autonomous system number. Threat blocking security servicescan also provide user agent blocking to allow a user to create a rule toblock or challenge a specific User Agent from accessing a domain, or azone lockdown to allow the whitelisting of specific IP addresses and IPranges.

Access control security services can include multi-user access,role-based access, and single sign-on support. Multi-user access allowsan administrator to invite other users to manage the account as anadministrator. In an embodiment, invited administrators can have fullcontrol over the account except for managing members and changingbilling information. Role-based access enables organizations tocollaborate across one account and use roles-based permissions tocontrol access. In an embodiment, each user is assigned an individualAPI key and can use two-factor authentication to protect their ownaccount. Single sign-on support allows for centralized identity andaccess management by allowing owners to set up and define who can accesstheir accounts with their chosen identity provider.

Access control security services can also enable a user or administratorto monitor user access and change logs. For example, the system can logrecent logins, access requests, and policy changes, and provideinformation indicating affected users, associated IPs, domains, actionstaken, and timestamps.

Payment Card Industry Data Security Standards (PCI DSS) is a set ofsecurity standards designed to ensure that businesses that accept,process, store, or transmit credit card information maintain a secureenvironment. In an embodiment, by enabling web application firewall andModern TLS Only mode ensures that a business remains in compliance withthe latest PCI DSS standards.

DDoS attacks can be difficult to mitigate when they originate from manyunique IP addresses and mimic legitimate traffic. Rate limiting servicescan protect against such DDoS attacks, as well as protect sensitiveinformation against brute-force login attempts and other types ofabusive behavior. In an embodiment, rate limiting provides the abilityto configure thresholds, define responses, and obtain information aboutspecific URLs of websites, applications, or API endpoints. Examples ofthresholds can include allowing a certain number of requests per minutefrom each unique IP address, a certain number of login attempts, etc.Example response configurations can include enabling mitigating actions(e.g., challenges or CAPTCHAS), response codes, etc. Implementation ofrate limiting service can reduce bandwidth usage by eliminatingunpredictable traffic spikes or attacks.

In an embodiment, the distributed cloud computing network 120 includesone or more control servers that are operated by the service. Thecontrol server(s) provide a set of tools and interfaces for thecustomers and is accessible over the Internet. For example, the controlserver(s), among other things, allow the customer to configure theperformance services and/or security services including specifying oneor more IP addresses and the services and/or functions to apply to thoseIP address(es). The control server(s) can also configure other settingsfor the performance services and/or security services (e.g.,create/apply firewall rules, caching functions, image optimizationsettings, load balancing settings, mobile device settings, threatprotection, DDoS management/trigger, rate limiting rules, etc.). Thesettings can be selectively applied to one or more of their IPaddresses, pages, and/or resources.

In the preceding description, numerous specific details are set forth toprovide a more thorough understanding. It will be appreciated, however,by one skilled in the art that embodiments may be practiced without suchspecific details. In other instances, control structures, gate levelcircuits and full software instruction sequences have not been shown indetail in order not to obscure understanding. Those of ordinary skill inthe art, with the included descriptions, will be able to implementappropriate functionality without undue experimentation.

References in the specification to “one embodiment,” “an embodiment,”“an example embodiment,” etc., indicate that the embodiment describedmay include a particular feature, structure, or characteristic, butevery embodiment may not necessarily include the particular feature,structure, or characteristic. Moreover, such phrases are not necessarilyreferring to the same embodiment. Further, when a particular feature,structure, or characteristic is described in connection with anembodiment, it is submitted that it is within the knowledge of oneskilled in the art to affect such feature, structure, or characteristicin connection with other embodiments whether explicitly described.

The techniques shown in the figures can be implemented using code anddata stored and executed on one or more electronic devices (e.g., acompute server). Such electronic devices store and communicate(internally and/or with other electronic devices over a network) codeand data using computer-readable media, such as non-transitorycomputer-readable storage media (e.g., magnetic disks; optical disks;random access memory; read only memory; flash memory devices;phase-change memory) and transitory computer-readable communicationmedia (e.g., electrical, optical, acoustical or other form of propagatedsignals—such as carrier waves, infrared signals, digital signals). Inaddition, such electronic devices typically include a set of one or moreprocessors coupled to one or more other components, such as one or morestorage devices (non-transitory machine-readable storage media), userinput/output devices (e.g., a keyboard, a touchscreen, and/or adisplay), and network connections. The coupling of the set of processorsand other components is typically through one or more busses and bridges(also termed as bus controllers). Thus, the storage device of a givenelectronic device typically stores code and/or data for execution on theset of one or more processors of that electronic device. Of course, oneor more parts of an embodiment of the invention may be implemented usingdifferent combinations of software, firmware, and/or hardware.

While the flow diagrams in the figures show a particular order ofoperations performed by certain embodiments of the invention, such orderis exemplary (e.g., alternative embodiments may perform the operationsin a different order, combine certain operations, overlap certainoperations, etc.).

While the invention has been described in terms of several embodiments,those skilled in the art will recognize that the invention is notlimited to the embodiments described, can be practiced with modificationand alteration within the spirit and scope of the appended claims. Thedescription is thus to be regarded as illustrative instead of limiting.

What is claimed is:
 1. A method, comprising: mapping a plurality of IPaddresses to one or more groupings, wherein the plurality of IPaddresses are anycast IP addresses for which a plurality of computeservers of a distributed cloud computing network share, wherein theplurality of IP addresses are to be used as source IP addresses of thedistributed cloud computing network when transmitting traffic todestinations external to the distributed cloud computing network, andwherein the map of the plurality of IP addresses to the one or moregroupings is made available to destinations external to the distributedcloud computing network; receiving, at a first compute server of theplurality of compute servers of the distributed cloud computing network,traffic originating from a client device that is destined to adestination external to the distributed cloud computing network;selecting a first IP address out of the plurality of IP addresses,wherein the selection is based on one or more characteristics applicablefor the received traffic and the map of the plurality of IP addresses tothe one or more groupings; and transmitting the received traffic fromthe first compute server to the destination external to the distributedcloud computing network, wherein the transmitted traffic uses theselected first IP address out of the plurality of IP addresses as asource IP address.
 2. The method of claim 1, further comprising: whereinthe map of the plurality of IP addresses is to geographic locations;wherein the one or more characteristics applicable for the receivedtraffic includes a geolocation of the received traffic; and wherein theselected IP address is selected based on the geolocation of the receivedtraffic and the map of the first IP addresses.
 3. The method of claim 2,wherein the geolocation of the received traffic includes a jurisdiction,and wherein selecting the first IP address out of the plurality of IPaddresses includes determining that the selected first IP address is thesame jurisdiction.
 4. The method of claim 2, wherein the selected firstIP address has the closest distance to the determined geolocation of thereceived traffic.
 5. The method of claim 2, wherein the first computeserver determines the one or more characteristics applicable for thereceived traffic including the geolocation of the received traffic,wherein determining the geolocation of the received traffic includesaccessing a public database to determine the geolocation of the receivedtraffic based on a source IP address of the received traffic.
 6. Themethod of claim 2, wherein the first compute server determines the oneor more characteristics applicable for the received traffic includingthe geolocation of the received traffic, wherein determining thegeolocation of the received traffic includes requesting a location fromthe client device.
 7. The method of claim 2, wherein the map of theplurality of IP addresses to geographic locations is made available to apublic database that is available to the destinations external to thedistributed cloud computing network.
 8. The method of claim 2, whereinthe map of the plurality of IP addresses to geographic locations is madeavailable for download from the distributed cloud computing network tothe destinations external to the distributed cloud computing network. 9.The method of claim 1, further comprising: receiving at a second computeserver of a plurality of compute servers of the distributed cloudcomputing network, return traffic from the destination external to thedistributed cloud computing network, wherein the return traffic isdirected to the selected first IP address; determining, at the secondcompute server, that the first compute server transmitted the traffic tothe destination external to the distributed cloud computing network; andforwarding the return traffic from the second compute server to thefirst compute server.
 10. The method of claim 1, further comprising:receiving, at the first compute server of the plurality of computeservers of the distributed cloud computing network, second trafficoriginating from a second client device that is destined to a seconddestination external to the distributed cloud computing network;selecting a second IP address out of the plurality of IP addresses,wherein the selection is based on one or more characteristics applicablefor the received second traffic and the map of the plurality of IPaddresses to the one or more groupings; determining that a secondcompute server of the plurality of compute servers of the distributedcloud computing network is expected to receive return traffic for thereceived second traffic originating from the second client device thatis destined to the second destination external to the distributed cloudcomputing network; proxying the received second traffic from the firstcompute server to the determined second compute server; and transmittingthe received second traffic from the determined second compute server tothe destination external to the distributed cloud computing network,wherein the transmitted second traffic uses the selected second IPaddress out of the plurality of IP addresses as a source IP address. 11.A non-transitory machine-readable storage medium that providesinstructions that, when executed by a processor, causes said processorto carry out the following operations: mapping a plurality of IPaddresses to one or more groupings, wherein the plurality of IPaddresses are anycast IP addresses for which a plurality of computeservers of a distributed cloud computing network share, wherein theplurality of IP addresses are to be used as source IP addresses of thedistributed cloud computing network when transmitting traffic todestinations external to the distributed cloud computing network, andwherein the map of the plurality of IP addresses to the one or moregroupings is made available to destinations external to the distributedcloud computing network; receiving, at a first compute server of theplurality of compute servers of the distributed cloud computing network,traffic originating from a client device that is destined to adestination external to the distributed cloud computing network;selecting a first IP address out of the plurality of IP addresses,wherein the selection is based on one or more characteristics applicablefor the received traffic and the map of the plurality of IP addresses tothe one or more groupings; and transmitting the received traffic fromthe first compute server to the destination external to the distributedcloud computing network, wherein the transmitted traffic uses theselected first IP address out of the plurality of IP addresses as asource IP address.
 12. The non-transitory machine-readable storagemedium of claim 11, wherein the map of the plurality of IP addresses isto geographic locations, wherein the one or more characteristicsapplicable for the received traffic includes a geolocation of thereceived traffic, and wherein the selected IP address is selected basedon the geolocation of the received traffic and the map of the first IPaddresses.
 13. The non-transitory machine-readable storage medium ofclaim 12, wherein the geolocation of the received traffic includes ajurisdiction, and wherein selecting the first IP address out of theplurality of IP addresses includes determining that the selected firstIP address is the same jurisdiction.
 14. The non-transitorymachine-readable storage medium of claim 12, wherein the selected firstIP address has the closest distance to the determined geolocation of thereceived traffic.
 15. The non-transitory machine-readable storage mediumof claim 12, wherein the first compute server determines the one or morecharacteristics applicable for the received traffic including thegeolocation of the received traffic, wherein determining the geolocationof the received traffic includes accessing a public database todetermine the geolocation of the received traffic based on a source IPaddress of the received traffic.
 16. The non-transitory machine-readablestorage medium of claim 12, wherein the first compute server determinesthe one or more characteristics applicable for the received trafficincluding the geolocation of the received traffic, wherein determiningthe geolocation of the received traffic includes requesting a locationfrom the client device.
 17. The non-transitory machine-readable storagemedium of claim 12, wherein the map of the plurality of IP addresses togeographic locations is made available to a public database that isavailable to the destinations external to the distributed cloudcomputing network.
 18. The non-transitory machine-readable storagemedium of claim 12, wherein the map of the plurality of IP addresses togeographic locations is made available for download from the distributedcloud computing network to the destinations external to the distributedcloud computing network.
 19. The non-transitory machine-readable storagemedium of claim 11, wherein the operations further comprise: receivingat a second compute server of a plurality of compute servers of thedistributed cloud computing network, return traffic from the destinationexternal to the distributed cloud computing network, wherein the returntraffic is directed to the selected first IP address; determining, atthe second compute server, that the first compute server transmitted thetraffic to the destination external to the distributed cloud computingnetwork; and forwarding the return traffic from the second computeserver to the first compute server.
 20. The non-transitorymachine-readable storage medium of claim 11, wherein the operationsfurther comprise: receiving, at the first compute server of theplurality of compute servers of the distributed cloud computing network,second traffic originating from a second client device that is destinedto a second destination external to the distributed cloud computingnetwork; selecting a second IP address out of the plurality of IPaddresses, wherein the selection is based on one or more characteristicsapplicable for the received second traffic and the map of the pluralityof IP addresses to the one or more groupings; determining that a secondcompute server of the plurality of compute servers of the distributedcloud computing network is expected to receive return traffic for thereceived second traffic originating from the second client device thatis destined to the second destination external to the distributed cloudcomputing network; proxying the received second traffic from the firstcompute server to the determined second compute server; and transmittingthe received second traffic from the determined second compute server tothe destination external to the distributed cloud computing network,wherein the transmitted second traffic uses the selected second IPaddress out of the plurality of IP addresses as a source IP address.